<!--
    group: 信息管理
    name: 我的合同详情
    url: /infoManagement/contractChannelDetails
-->
<template>
  <div style="background-color: #ffffff; padding: 30px;">
    <ContractDetails :agreeId="agreeId"></ContractDetails>

    <a-button v-if="renewDeatil.status == 5" type="primary" @click="appeal" style="margin: 30px 0 0 90px;">我要申诉</a-button>

    <!-- 合同申诉  -->
    <UploadZxyLegalLetter
      v-show="appealShow"
      :appealShow="appealShow"
      :renewDeatil="renewDeatil"
      @handlerCancel="handlerCancel"
    />

  </div>
</template>

<script>
import { getContractDetails } from '@/api/setting'
import ContractDetails from '@/views/infoManagement/contractDetails.vue'
import UploadZxyLegalLetter from '@/views/infoManagement/modules/uploadZxyLegalLetter'
export default {
  name: 'contractChannelDetails',
  components:{
    ContractDetails,
    UploadZxyLegalLetter
  },
  data(){
    return{
      agreeId:'',

      //合同申诉
      appealShow: false,
      renewDeatil:{},
    }
  },
  mounted() {
    this.agreeId = this.$route.query.agreeId;
    this.getDetailData();
  },
  methods:{
    //我要申诉
    appeal(){
      this.appealShow = true;
    },
    //关闭合同申诉
    handlerCancel(){
      this.$nextTick(()=>{
        this.appealShow = false;
      })
      this.getDetailData();
    },
    //获取合同详情
    getDetailData(){
      let id = this.agreeId;
      getContractDetails(id).then(res => {
        if (res.success){
          this.renewDeatil = res.result;
        }else{
          this.$message.warning(res.message);
        }
      })
    }
  }
}
</script>

<style scoped lang="less">

</style>
